package com.nulldev.util.web.YouTubeExtractor.signatures.extractor;

import com.nulldev.util.concurrency.threadIt.v4.emapi.uft.Executable;
import com.nulldev.util.web.YouTubeExtractor.signatures.ExtractedSignatureData;

public abstract class Extractor {
	private ExtractedSignatureData data;

	public Extractor(final ExtractedSignatureData data) {
		if (data == null)
			throw new RuntimeException("Extractor::data cannot be null!");
		this.data = data;
	}

	public abstract String decrypt(final String signature);

	public abstract Executable<String> decryptTask(final String signature);

	public abstract String getCode();

	public abstract String getFunctionCode();

	public abstract String getFunctionName();

	public ExtractedSignatureData getExtractedData() {
		return this.data;
	}

	public abstract Extractor updateESD(final ExtractedSignatureData newData);

	protected void setExtractedData(final ExtractedSignatureData newData) {
		if (newData == null)
			throw new RuntimeException("newData == null!");
		this.data = newData;
	}
}
